<!---
	Copyright 2010 Edward Trudeau, Jeremy Battle
    This software is freely available under the MIT License: http://www.opensource.org/licenses/mit-license.php
    http://ayc.googlecode.com
    
--->

<!--- module to return menu --->
<cfparam name="attributes.menuStyle" default="main" />
<cfparam name="attributes.activeTab" default="" />
<cfparam name="attributes.activeMenuID" default="folder" />

<cfif thisTag.executionMode eq "start">
<cfif attributes.menuStyle EQ "jams">
	<div id="navigation">
    <ol>
    	<cfif structKeyExists(session,"loggedin") and session.loggedin>
            <li id="nav1" style="width:110px;"><a href="<cfoutput>#request.baseurl#/secure/index.cfm</cfoutput>" <cfif attributes.activeTab EQ "nav1">class="active"</cfif> accesskey="1"><span>Home</span></a></li>
            <li id="nav2" style="width:130px;"><a href="<cfoutput>#request.baseurl#/secure/reporting/index.cfm?action=createCase</cfoutput>" <cfif attributes.activeTab EQ "nav2">class="active"</cfif> accesskey="2"><span>Submit IR</span></a></li>
            <cfset nextNavItem = 3 />
            <cfmodule template="/mod/securityCheck.cfm" var="vuChk" Perm="Manage Database" level="Read Only"></cfmodule>
            <cfmodule template="/mod/securityCheck.cfm" var="viewChk" Perm="User Maintenance" level="Read Only"></cfmodule>
            <cfmodule template="/mod/securityCheck.cfm" var="admChk" Perm="Manage Database" Level="Admin"></cfmodule>		
            <cfif vuChk>
				<cfoutput><li id="nav#nextNavItem#" style="width:130px;"><a href="#request.baseurl#/secure/_manage" <cfif attributes.activeTab EQ "nav#nextNavItem#">class="active"</cfif> accesskey="#nextNavItem#"><span>Manage DB</span></a></li></cfoutput>
                <cfset nextNavItem = nextNavItem + 1 />
        	</cfif>
			<cfif viewChk>   
				<cfoutput><li id="nav#nextNavItem#" style="width:150px;"><a href="#request.baseurl#/secure/UserMaint/choosemember.cfm" <cfif attributes.activeTab EQ "nav#nextNavItem#">class="active"</cfif> accesskey="#nextNavItem#"><span>Manage Users</span></a></li></cfoutput>
                <cfset nextNavItem = nextNavItem + 1 />
            </cfif>
        	<cfif admChk>   
				<cfoutput><li id="nav#nextNavItem#" style="width:200px;"><a href="#request.baseurl#/secure/allCases.cfm" <cfif attributes.activeTab EQ "nav#nextNavItem#">class="active"</cfif> accesskey="#nextNavItem#"><span>Historical Data</span></a></li></cfoutput>
                <cfset nextNavItem = nextNavItem + 1 />
                <cfoutput><li id="nav#nextNavItem#" style="width:140px;"><a href="#request.baseurl#/secure/admin" <cfif attributes.activeTab EQ "nav#nextNavItem#">class="active"</cfif> accesskey="#nextNavItem#"><span>JAMS Admin</span></a></li></cfoutput>
                <cfset nextNavItem = nextNavItem + 1 />
        	</cfif>
            <cfoutput><li id="nav#nextNavItem#" style="width:100px;"><a href="#request.baseurl#/secure/index.cfm?logout=1" <cfif attributes.activeTab EQ "nav#nextNavItem#">class="active"</cfif> accesskey="#nextNavItem#"><span>Logout</span></a></li></cfoutput>
            <cfset nextNavItem = nextNavItem + 1 />
        <cfelse>
            <li id="nav1" style="width:200px;"><a href="<cfoutput>#request.baseurl#/index.cfm</cfoutput>" <cfif attributes.activeTab EQ "nav1">class="active"</cfif> accesskey="1"><span>Home</span></a></li>
        </cfif>
    </ol>
    </div>
<cfelseif attributes.menuStyle eq "incidentReporting">
	<div id="left-rail">
        <ul id="left-nav">
        	<cfoutput>
            <li><a href="#request.baseurl#/secure/reporting/incidentData.cfm?cid=#url.cid#">Details</a></li>
            <li><a href="#request.baseurl#/secure/reporting/incidentRespondents.cfm?cid=#url.cid#">Respondents</a></li>
            <li><a href="#request.baseurl#/secure/reporting/involvedParties.cfm?cid=#url.cid#&iid=1">Subjects</a></li>    
            <li><a href="#request.baseurl#/secure/reporting/involvedParties.cfm?cid=#url.cid#&iid=2">Witnesses</a></li>
            <li><a href="#request.baseurl#/secure/reporting/involvedParties.cfm?cid=#url.cid#&iid=3">Complainants</a></li>
            <li><a href="#request.baseurl#/secure/reporting/incidentDescription.cfm?cid=#url.cid#">Description</a></li>
            <li><a href="#request.baseurl#/secure/reporting/incidentReport.cfm?cid=#url.cid#">Submit</a></li>
            </cfoutput>
    	</ul>
    </div>
<cfelseif attributes.menuStyle eq "IRManagement">
	<cfif structKeyExists(url,"cid") and isValid("integer",url.cid) and structKeyExists(url,"pid") and isValid("integer",url.pid)>
	<cfset adjudicationLevel = request.DiscDataService.getDiscData(url.cid,url.pid).getAdjudicationLevel()>
	<div id="left-rail">
        <ul id="left-nav">
        	<cfoutput>
            <li><a href="#request.baseurl#/secure/management/viewSubjects.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif>t=1">View Case Subjects</a></li>
            <li><a href="#request.baseurl#/secure/management/addIncidentCharges.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Charges</a></li>
            <li><a href="#request.baseurl#/secure/management/subjectAdjudication.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Adjudication Status [<cfswitch expression="#adjudicationLevel#"><cfcase value="1">None</cfcase><cfcase value="2">Letter of Warning</cfcase><cfcase value="3">Disciplinary Conference</cfcase><cfcase value="4">Disciplinary Hearing</cfcase><cfcase value="5">Correspondence</cfcase><cfdefaultcase>None</cfdefaultcase></cfswitch>]</a></li>
            <cfif adjudicationLevel EQ 3>
            <li><a href="#request.baseurl#/secure/management/addCaseOfficer.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Case Officer</a></li>
            <li><a href="#request.baseurl#/secure/management/addMeetingDate.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Hearing Date</a></li>
            <li><a href="#request.baseurl#/secure/management/addViolations.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Violations</a></li>
            <li><a href="#request.baseurl#/secure/management/addSanctions.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Sanctions</a></li>
            <cfelseif adjudicationLevel EQ 4>
            <li><a href="#request.baseurl#/secure/management/addHearingOfficer.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Hearing Officer</a></li>
            <li><a href="#request.baseurl#/secure/management/addMeetingDate.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Hearing Date</a></li>
            <li><a href="#request.baseurl#/secure/management/addViolations.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Violations</a></li>
            <li><a href="#request.baseurl#/secure/management/addSanctions.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Sanctions</a></li>
            </cfif>
            <li><a href="#request.baseurl#/secure/management/generateLetter.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Letters</a></li>
            <li><a href="#request.baseurl#/secure/management/closeCase.cfm?<cfif structKeyExists(url,"cid") and isValid("integer",url.cid)>cid=#url.cid#&</cfif><cfif structKeyExists(url,"pid") and isValid("integer",url.pid)>pid=#url.pid#&</cfif>t=1">Close Case</a></li>
            </cfoutput>
    	</ul>
    </div>
    </cfif>
<cfelseif attributes.menuStyle eq "Admin">
	<div id="left-rail">
    	<ul id="left-nav">
        	<cfoutput>
            <li><a href="#request.baseurl#/secure/admin/">JAMS Admin Home</a></li>
          	<li><a href="#request.baseurl#/secure/admin/lookup-list.cfm?LookupType=AdjudicationLevel">Adjudication Levels</a></li>
            <li><a href="#request.baseurl#/secure/admin/lookup-list.cfm?LookupType=AlcoholLevel">Alcohol Levels</a></li>
            <li><a href="#request.baseurl#/secure/admin/lookup-list.cfm?LookupType=AppealLevel">Appeal Levels</a></li>
            <li><a href="#request.baseurl#/secure/admin/area-list.cfm">Campus Areas</a></li>
            <li><a href="#request.baseurl#/secure/admin/lookup-list.cfm?LookupType=CaseStatus">Case Statuses</a></li>
            <li><a href="#request.baseurl#/secure/admin/charge-list.cfm">Charges</a></li>
            <li><a href="#request.baseurl#/secure/admin/lookup-list.cfm?LookupType=ClemencyStatus">Clemency Statuses</a></li>
            <li><a href="#request.baseurl#/secure/admin/lookup-list.cfm?LookupType=DisciplinaryStatus">Disciplinary Statuses</a></li>
            <li><a href="#request.baseurl#/secure/admin/lookup-list.cfm?LookupType=DrugLevel">Drug Levels</a></li>
            <li><a href="#request.baseurl#/secure/admin/letters.cfm">Letter Templates</a></li>
            <li><a href="#request.baseurl#/secure/admin/respondents.cfm">Respondents</a></li>            
            </cfoutput>
        </ul>
    </div>
<cfelseif attributes.menuStyle eq "ManageDB">
	<div id="left-rail">
    	<cfmodule template="/mod/securityCheck.cfm" var="vuChk" Perm="Manage Database" level="Read Only">
        <ul id="left-nav">
            <li><a href="<cfoutput>#request.baseURL#</cfoutput>/secure/index.cfm" class="sidemenu">Home</a></li>
        <cfif vuChk>
            <li><a href="<cfoutput>#request.baseURL#</cfoutput>/secure/_manage" class="sidemenu">Manage DB</a></li>		</cfif>
        <cfmodule template="/mod/securityCheck.cfm" var="viewChk" Perm="User Maintenance" level="Read Only">
        <cfif viewChk>
            <li><a href="<cfoutput>#request.baseURL#</cfoutput>/secure/UserMaint/choosemember.cfm" class="sidemenu">Maintain Users</a></li>
        </cfif>
            <li><a href="<cfoutput>#request.baseURL#</cfoutput>/?logout=1" class="sidemenu">Logout</a></li>
        </ul>
    </div>   
</cfif>
</cfif>


